package com.qingxin.ui.service;

import java.util.List;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qingxin.sys.entity.SysPermission;
import com.qingxin.sys.service.BaseService;
import com.qingxin.sys.service.SysPermissionService;
import com.qingxin.ui.bean.UIModule;

@Service
public class UiService extends BaseService<SysPermission, String> {
	
	@Autowired
	private SysPermissionService sysPermissionService;
	

	/**
	 * 获取模块信息
	 * @return
	 */
	public List<UIModule> getModules(){
		return sysPermissionService.getUIModules();
	}
	
	/**
	 * 获取用户权限编号集合
	 * @param userid
	 * @return
	 */
	public Set<String> getUserPermissions(String userid){
		return sysPermissionService.getUserPermissionCodes(userid);
		
	}
	
	
	
	/**
	 * 判断指定的动态视图标签是否应该显示
	 * @param dynamic
	 * @param request
	 * @return
	 */
	public boolean isIncludeDynamicCenterTab(String dynamic, HttpServletRequest request){
		return true;
	}
	
	
}
